package com.ukit.weather_xml.Other.DataManger

import androidx.room.Dao
import androidx.room.Insert
import androidx.room.OnConflictStrategy
import androidx.room.Query

@Dao
interface SettingsDao {
    @Insert(onConflict = OnConflictStrategy.REPLACE)
    suspend fun insertSettings(settings: Settings)

    @Query("SELECT * FROM settings")
    suspend fun getSettings(): MutableList<Settings>?

    @Query("UPDATE settings SET city = :newCity WHERE id = (SELECT MIN(id) FROM settings)")
    suspend fun updateCity(newCity: String)

}
